<?php
// +----------------------------------------------------------------------
// | 火凤凰CMS内容管理系统
// +----------------------------------------------------------------------
// | Copyright (c) 2015~2018 http://cxbs.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 赵志广 <amdin@cxbs.net>
// +----------------------------------------------------------------------
use think\Route;

Route::pattern([
    'name'  =>  '\w+',
    'id'    =>  '\d+',
]);
Route::group(['name'=>'api','ext'=>'html'], [
    'getadone-<id>$'	=> ['api/advertising/getOne',['method'=>'get'],[]],
    //  列表页
    'part-<fid>$'	=> ['api/Part/getList',['method'=>'get'],['fid' => '\d+']],
    'partlist-m<mid>-f<fid>$'	=> ['api/Part/getPartlist',['method'=>'get'],['mid' => '\d+','fid' => '\d+']],
    //  内容查询
    'article-<aid>$'   => ['api/Article/index',['method' => 'get','ext'=>'html'],['aid' => '\d+']],
    'm<mid>-f<fid>-o<order>-n<num>$'	=> ['api/Article/getList',['method'=>'get'],['mid' => '\d+','fid' => '\d+','order' => '\w+','num' => '\d+']],
    //  评论comment
    'comment-<class>-<id>$'   => ['api/Comment/getComment',['method' => 'get','ext'=>'html'],['class'=>'\w+','id'=>'\w+']],
    'addcomment$'   => ['api/Comment/add',['method' => 'post','ext'=>'html']],
    'listcomment$'   => ['api/Comment/getList',['method' => 'get|post','ext'=>'html']],

    //  站内信
    'smslist$'   => ['api/Sms/getList',['method' => 'get|post','ext'=>'html']],
    'smssee-<id>$'   => ['api/Sms/see',['method' => 'get|post','ext'=>'html'],['id'=>'\w+']],
    'delsee$'   => ['api/Sms/del',['method' => 'post','ext'=>'html']],

    //  课程预约
    'usermake-<id>$'   => ['api/OrderMake/get_make',['method' => 'get|post','ext'=>'html'],['id'=>'\d+']],
    'maketable$'   => ['api/OrderMake/get_maketable',['method' => 'get|post','ext'=>'html']], // 获取课程表

    //  用户信息
    'reg'   => ['api/User/reg',['method' => 'post','ext'=>'html']],
    'login'   => ['api/User/login',['method' => 'post','ext'=>'html']],
    'repwd'   => ['api/User/repwd',['method' => 'post','ext'=>'html']],
    'address$'   => ['api/UserAddress/add',['method' => 'post','ext'=>'html']], // 添加收货地址
    'user-edit$'   => ['api/User/edit',['method' => 'post','ext'=>'html']],
    'ucollection$'   => ['api/User/Ucollection',['method' => 'get|post','ext'=>'html']], //   收藏
    'user-money$'   => ['api/User/userMoney',['method' => 'get|post','ext'=>'html']], //查询 用户积分
    'user-moneylist$'   => ['api/User/userMoneyList',['method' => 'get|post','ext'=>'html']], //查询 用户积分 列表
    'oneuser-<name>$'   => ['api/User/getUser',['method' => 'post','ext'=>'html'],['name'=>'\w+']],
    'spread-<class>-<uid>$'   => ['api/User/getTui',['method' => 'get|post','ext'=>'html'],['class'=>'\w+','uid'=>'\d+']], //  获取推广链接

    //  发送验证码
    'phone-sms'   => ['api/Smscode/postSmscode',['method' => 'post','ext'=>'html']],

    //  支付
    '<class>pay<name>-<oid>$'   => ['api/Pay/index',['method' => 'get|post','ext'=>'html'],['class'=>'\w+','name'=>'\w+','oid'=>'\w+']],
    //  微信回调地址
    'endwxpay'   => ['api/Pay/postSmscode',['method' => 'get|post','ext'=>'html']],// 微信回调
    'getwxpay'   => ['api/Pay/wxpayend',['method' => 'get|post','ext'=>'html']], // 微信支付查询
    'getalipay'   => ['api/Pay/alipayend',['method' => 'get|post','ext'=>'html']],// 支付宝支付查询
    //  微信验证回调地址
    'wxtoken$'   => ['api/Wxtoken/index',['method' => 'get|post','ext'=>'html']],// 微信回调
    //  订单信息
    'addordercart$'	=> ['api/Order/addOrderShop',['method'=>'post','ext'=>'html']], //  添加到购物车
    'orderdelche$'	=> ['api/Order/Orderdelche',['method'=>'post','ext'=>'html']], //  删除购物车商品
    'order-add$'	=> ['api/Order/addOrder',['method'=>'post','ext'=>'html']], //  添加订单
    'getorder$'	=> ['api/Order/getOrder',['method'=>'get|post','ext'=>'html']], //  查询订单
    'getjiang$'	=> ['api/Order/getJiang',['method'=>'post','ext'=>'html']], //  查询中奖信息
    'getordercont-<name>$'	=> ['api/OrderCont/getOne',['method'=>'get','ext'=>'html'],['name'=>'\w+']], //  查询订单附加信息

    'getarticle$'	=> ['api/Order/getArticle',['method'=>'get|post','ext'=>'html']], //  查询产品购买量
    //  地区查询
    'chinacode$'	=> ['api/Chinacode/index',['method'=>'post','ext'=>'html']],
    //  上传
    'lupload'	=> ['api/Upload/linshi',['method'=>'post','ext'=>'html']],
]);
return [
    'index'   => ['Index/index',['method' => 'get|post','ext'=>'html']],
    'reg<t?>'   => ['Login/reg',['method' => 'get|post','ext'=>'html'],['t' => '\d+']],
    'login$'   => ['Login/login',['method' => 'get|post','ext'=>'html']],
    'part-<fid>$'   => ['Part/index',['method' => 'get','ext'=>'html'],['fid' => '\d+']],
    'article-<aid>$'   => ['Article/index',['method' => 'get','ext'=>'html'],['aid' => '\d+']],
    'user-<uid>$'   => ['User/getOne',['method' => 'get','ext'=>'html'],['uid' => '\d+']],
    'userlist-<group_id>$'   => ['User/userList',['method' => 'get','ext'=>'html'],['group_id' => '\d+']],
    'order<mid>che$'   => ['Order/getChe',['method' => 'get','ext'=>'html'],['mid' => '\d+']], //   购物车
    'addorder$'   => ['Order/addOrder',['method' => 'post','ext'=>'html']], //   下单
    'orderpay-<oid>$'   => ['Order/playOrder',['method' => 'get|post','ext'=>'html'],['oid' => '\w+']], //   订单支付页面
    '<cid>pay-<oid>$'   => ['Order/orderPay',['method' => 'get|post','ext'=>'html'],['cid' => '\w+','oid' => '\w+']], //   阿里支付页面
];